<template>
	<view class="">
		<view class="row-start ai-start padding-all-30 marginTop-10" style="background-color: #fff;" v-for="(item, index) in complaintList" :key="index">
			<view class="">
				<image :src="item.TargetUser.WxHeadPic" class="borderR-10" style="width: 100rpx;height: 100rpx;"></image>
			</view>
			<view class="marginLeft-20" style="width: 100%;">
				<view class="row-between">
					<view class="fs-30">
						{{ item.TargetUser.NickName }}
					</view>
					
					<view class="fs-30" style="color: #003599;" v-if="item.FeedbackType != 0" @click="onNav(item, item.FeedbackType)">
						<text>投诉</text>
						<text v-if="item.FeedbackType == 2">用户</text>
						<text v-if="item.FeedbackType == 3">通告</text>
						<text v-if="item.FeedbackType == 4">约单</text>
						<text v-if="item.FeedbackType == 5">作品</text>
						/{{ item.FeedCauseLabels }}
					</view>
					
					<view class="fs-30" style="color: #003599;" v-else>
						意见反馈
						/{{ item.FeedCauseLabels }}
					</view>
				</view>
				<view class="fs-26 marginTop-10 " style="letter-spacing: 1rpx;">
					{{ item.FeedCauseMemo }}
				</view>
				<view class="marginTop-20">
					<image v-for="(Timage, idx) in JSON.parse(item.FeedPics)" :key="idx" :src="Timage" class="marginRight-10 borderR-5" style="width: 150rpx;height: 150rpx;" mode="aspectFill"</image>
				</view>
				<view class="fs-26 marginTop-10" style="color: #d6d6d6;">
					{{ item.addTime }}
				</view>
				<view class="fs-24 borderR-5 padding-all-20 marginTop-10" style="background-color: #e6e6e6;letter-spacing: 1rpx;" v-if="item.FeedbackMemo">
					系统回复: {{item.FeedbackMemo}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// FeedbackType反馈类型：
	// 0意见反馈，
	// 1投诉，
	// 2投诉用户，
	// 3投诉通告，
	// 4投诉约单，
	// 5投诉作品
	
	export default {
		data() {
			return {
				complaintList: []
			}
		},
		onLoad() {
			this.getComplaintList()
		},
		methods: {
			onNav(item, type) {
				if (type == 2) this.$common.goNavPage(`/artistesPages/pages/artister?artisterID=${item.TargetID}`)
				if (type == 3) this.$common.goNavPage(`/notice/details?NoticeID=${item.TargetID}`)
				if (type == 4) this.$common.goNavPage(`/reservationorder/details?OrderID=${item.TargetID}`)
				if (type == 5) this.$common.goNavPage(`/works/details?WorksID=${item.TargetID}`)
			},
			getComplaintList() {
				this.$httpost('/Feedback/List',{}).then(res => {
					console.log('投诉列表', res)
					if (res.code == 200) {
						this.complaintList = res.data.list;
					}
				})
			}
		}
	}
</script>

<style>
</style>